package com.yzkj.cpjxc.business.domain;

import com.yzkj.cpjxc.business.constants.SysUserConstants;
import org.apache.ibatis.type.Alias;

/**
 * 系统用户展示vo
 */
@Alias("SysUserShowVo")
public class SysUserShowVo extends SysUser {

	private static final long serialVersionUID = -4170264702541529935L;

	/**
	 * 状态：中文
	 */
	private String statusName;

	/**
	 * 删除状态中文
	 */
	private String deleteFlagName;

	/**
	 * 部门id
	 */
	private String deptId;

	/**
	 * 部门name
	 */
	private String deptName;

	/**
	 * 角色name
	 */
	private String roleName;

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getDeptId() {
		return deptId;
	}

	public void setDeptId(String deptId) {
		this.deptId = deptId;
	}

	public String getDeptName() {
		return deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	public String getStatusName() {
		return SysUserConstants.getUserStatusMap().get(getStatus());
	}

	public void setStatusString(String statusString) {
		this.statusName = statusString;
	}

	public void setStatusName(String statusName) {
		this.statusName = statusName;
	}

	public void setDeleteFlagName(String deleteFlagName) {
		this.deleteFlagName = deleteFlagName;
	}

	public String getDeleteFlagName() {
		return SysUserConstants.getUserDeleteFlagMap().get(getDeleteFlag());
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((deleteFlagName == null) ? 0 : deleteFlagName.hashCode());
		result = prime * result + ((deptId == null) ? 0 : deptId.hashCode());
		result = prime * result + ((deptName == null) ? 0 : deptName.hashCode());
		result = prime * result + ((roleName == null) ? 0 : roleName.hashCode());
		result = prime * result + ((statusName == null) ? 0 : statusName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		SysUserShowVo other = (SysUserShowVo) obj;
		if (deleteFlagName == null) {
			if (other.deleteFlagName != null)
				return false;
		} else if (!deleteFlagName.equals(other.deleteFlagName))
			return false;
		if (deptId == null) {
			if (other.deptId != null)
				return false;
		} else if (!deptId.equals(other.deptId))
			return false;
		if (deptName == null) {
			if (other.deptName != null)
				return false;
		} else if (!deptName.equals(other.deptName))
			return false;
		if (roleName == null) {
			if (other.roleName != null)
				return false;
		} else if (!roleName.equals(other.roleName))
			return false;
		if (statusName == null) {
			if (other.statusName != null)
				return false;
		} else if (!statusName.equals(other.statusName))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "SysUserShowVo [statusName=" + statusName + ", deleteFlagName=" + deleteFlagName + ", deptId=" + deptId + ", deptName=" + deptName + ", roleName=" + roleName + "]";
	}

}
